package wangjg.security;

import wangjg.commons.bean.XmlBeanFactory;
import wangjg.security.core.LoginModule;
import wangjg.security.core.validator.RequestValidator;

/**
 * @author wangjg
 */
public class SecurityContext {
	private LoginModule loginModule;
	private RequestValidator requestValidator;

	public SecurityContext(){
		
	}

	public LoginModule getLoginModule() {
		return loginModule;
	}

	public void setLoginModule(LoginModule loginModule) {
		this.loginModule = loginModule;
	}

	public RequestValidator getRequestValidator() {
		return requestValidator;
	}

	public void setRequestValidator(RequestValidator av) {
		this.requestValidator = av;
	}
	
	public static SecurityContext load(String xmlPath){
		XmlBeanFactory beanFactory = new XmlBeanFactory(xmlPath);
		SecurityContext sc = (SecurityContext)beanFactory.getBean("securityContext");
		return sc;
	}
}
